From: Juanma Barranquero Date: Fri, 12 Jul 2002 11:56:30 +0000 (+0000) Subject: (timer-set-time-with-usecs): Fix documentation. Simplify extraction of time data. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~31735 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=6613cfa3d861c35fb20e17dac82fe0edbd98367d;p=emacs.git (timer-set-time-with-usecs): Fix documentation. Simplify extraction of time data. --- diff --git a/lisp/timer.el b/lisp/timer.el index 0c159c6023d..c98d160d57f 100644 --- a/lisp/timer.el +++ b/lisp/timer.el @@ -137,14 +137,15 @@ SECS may be a fraction." (aset timer 3 (or (nth 2 time) 0)))) (defun timer-set-time-with-usecs (timer time usecs &optional delta) - "Set the trigger time of TIMER to TIME. + "Set the trigger time of TIMER to TIME plus USECS. TIME must be in the internal format returned by, e.g., `current-time'. -If optional third argument DELTA is a non-zero integer, make the timer +The microsecond count from TIME is ignored, and USECS is used instead. +If optional fourth argument DELTA is a non-zero integer, make the timer fire repeatedly that many seconds apart." (or (timerp timer) (error "Invalid timer")) - (aset timer 1 (car time)) - (aset timer 2 (if (consp (cdr time)) (car (cdr time)) (cdr time))) + (aset timer 1 (nth 0 time)) + (aset timer 2 (nth 1 time)) (aset timer 3 usecs) (aset timer 4 (and (numberp delta) (> delta 0) delta)) timer)